<!--div id="loader" class="container"-->
    <div class="col-md-offset-1">
        <div class="col-md-11">
			<div class="panel-body well">
				<div>
					<table width="30%" border=0>
					<tr><td width="10%"><b>Type Name</td><td width="1%">:</b></td><td width="10%"><?php echo $header_data['MST_TYPE_DESC']; ?></td></tr> 
					<tr><td><b>Room Name</td><td>:</b></td><td><?php echo $header_data['MST_CATEGORY_DESC']; ?></td></tr>
					<tr><td><b>Floor</td><td>:</b></td><td><?php echo $header_data['MST_FLOOR_DESC']; ?></td></tr>
					</table>
				</div><hr color="red">
				<form method="post" id="formuser" action="#" enctype="multipart/form-data" class="form-horizontal" role="form">
				<h4><b class="caret"></b><b> Form - Edit Room Item</b></h4>
				<div class="col-sm-8">
					<div class="col-sm-4"><label for="l_item" class="control-label">Item Name</label></div>
					<div class="col-sm-4"><input type="text" class="form-control input-sm" id="item" name="item" value="<?php echo $list_data['ITEM_PUBLIC_ROOM_NAME'] ?>" disabled></div>
				</div>
				<div class="col-sm-8">
					<div class="col-sm-4"><label for="l_item" class="control-label">Item Qty</label></div>
					<div class="col-sm-4"><input type="text" class="form-control input-sm" id="qty" name="qty" value="<?php echo $list_data['ITEM_PUBLIC_ROOM_QTY'] ?>"></div>
				</div>
				<div class="col-sm-8">
					<div class="col-sm-4"><label for="l_item" class="control-label">Item Uom</label></div>
					<div class="col-sm-4"><input type="text" class="form-control input-sm" id="uom" name="uom" value="<?php echo $list_data['ITEM_PUBLIC_ROOM_UOM'] ?>"></div>
				</div>
				<div class="col-sm-8" style="padding-bottom: 10px;">
					<div class="col-sm-4">
						&nbsp;
					</div>
				</div>
				<div class="col-sm-8">
					<div class="col-sm-4"><label for="button" class="control-label">&nbsp;</label></div>
					<div class="col-sm-4">
						<button type="button" class="btn btn-success btn-block" onclick="save('<?php echo $room_id ?>','<?php echo $type ?>','<?php echo $public_room_id ?>');">
						<!--span class="glyphicon glyphicon-saved"></span--> Save Edit</button>
					</div>
					<div class="col-sm-4">
						<button type="button" class="btn btn-default btn-block" onclick="cancel('<?php echo $room_id ?>','<?php echo $type ?>');">
						<!--span class="glyphicon glyphicon-circle-arrow-left"></span--> Cancel</button>
					</div>
				</div>
				</form>
			</div>
		</div>
	</div>
<!--/div-->

<script type="text/javascript">
	function cancel(room_id,type) {
        $.post("<?= site_url() ?>setup/view_detail", {room_id: room_id, type: type}, function(data) {
            $('#loader').html(data);
        });
    }
	function save(room_id,type,public_room_id) {
        $.post("<?= site_url() ?>setup/save_detail2", {
			room_id: room_id, 
			type: type, 
			public_room_id: public_room_id, 
			qty: $('#qty').val(), 
			uom: $('#uom').val() 
		}, 
		function(data) {
            $('#loader').html(data);
        });
    }
</script>
